// 继承
// 父类
var Animal = {
    CreateNew:function(){
        var animal = {};
        animal.sleep = function() {
            console.log('睡觉觉');
        }
        return animal;
    }
}

var Cat = {
    createNew: function(name){
        var cat = Animal.CreateNew();
        cat.name=name;
        var sound = '喵喵喵';  // 私有
        cat.makeSound = function() {
            console.log(sound);
        }
        return cat;
    }
}

var tom = Cat.createNew('Tom');
console.log(tom.name);  //public private protect static
// console.log(tom.sound); 
tom.makeSound();
tom.sleep();
